import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutterroom/pages/home/tab_index/index_recommond.dart';
import 'package:flutterroom/pages/home/tab_index/index_recommond_data.dart';
import 'package:flutterroom/pages/home/widgets/common_image.dart';

var textStyle =TextStyle(fontWeight: FontWeight.w500,fontSize: 15);

class IndexRecommondItemWidget extends StatelessWidget {
  final IndexRecommendItem data;

  const IndexRecommondItemWidget({Key key, this.data}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        Navigator.of(context).pushNamed(data.navigateUri);
      },
      child: Container(
        decoration: BoxDecoration(color: Colors.white),
        width: ScreenUtil().setWidth(750) / 2 - 20,
        padding: EdgeInsets.all(10),
        // height: 100,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: <Widget>[
            Column(
              children: <Widget>[
                Text(data.title,style: textStyle,),
                Text(data.subTitle,style: textStyle,),
              ],
            ),
            CommonImage(data.imageUri,width: 55)
          ],
        ),
      ),
    );
  }
}
